<style>
	input#amount_money
	{
		padding:10px 20px;
		font-size:30px;
		font-family:DigitaldreamFatNarrowRegular;
		text-align:right;
		width:266px;
	}
	
	.ui-menu .ui-menu-item a{
			font-size:11px;
			font-weight:bold;
	}
	.ui-autocomplete.source:hover {
		background: #454545;
	}
	.ui-autocomplete-loading {
    background: white url('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/images/ui-anim_basic_16x16.gif') right center no-repeat;
  }
  .group{
		background:#f00;
  }
</style>

<div id="main-modal-menu" class="reveal-modal" style="position:absolute;">
  <h2>Please choose an option.</h2>
  <a href="#" data-reveal-id="deductions" class="btn btn-primary">Add A Deduction.</a> 
  <a href="#" data-reveal-id="scholarships" class="btn btn-primary">Add A Scholarship.</a>
  <a class="close-reveal-modal">&#215;</a>
</div>

<!--- Assessment Fee -->
<div id="assessment_fee-modal-menu" class="reveal-modal">
  <h2>Are you sure?</h2>
  <a href="#" data-reveal-id="assessment_fee_from" class="btn btn-primary">Add Assessment Fee Payment Record</a> 
  <a class="close-reveal-modal">&#215;</a>
</div>

<div id="penalty-assessment-modal-menu" class="reveal-modal expand">
 <h4 class="subheader">Penalty Assessment</h4>
  <form action="<?=site_url('fees/view_fees/'.$id);?>" method="POST">
  <fieldset>
	<div class="row collapse">
		<div class="small-3 large-2 columns">
		  <span class="prefix">Charge</span>
		</div>
		<div class="small-9 large-10 columns">
		  <input type="text" name="password" maxlength="20" class="decimal" autocomplete="off" required>
		</div>
	</div>
	<div class="row collapse">
		<input type="submit" name="add_penalty_assessment" value="Submit" class="button tiny">
		<input type="reset" value="Clear" class="button tiny">
	</div>
  </fieldset>
  </form>
  <a class="close-reveal-modal">&#215;</a>
</div>
<!-- end Assessment Fee -->

<!--- Foreign Fee -->
<div id="foreign-fee-modal" class="reveal-modal expand">
 <h4 class="subheader">Foreign Fee</h4>
  <form action="<?=site_url('fees/view_fees/'.$id);?>" method="POST">
  <fieldset>
	<div class="row collapse">
		<div class="small-3 large-2 columns">
		  <span class="prefix">Amount</span>
		</div>
		<div class="small-9 large-10 columns">
		  <input type="text" name="password" maxlength="20" class="decimal" autocomplete="off" required>
		</div>
	</div>
	<div class="row collapse">
		<input type="submit" name="add_foreign_fee" value="Submit" class="button tiny">
		<input type="reset" value="Clear" class="button tiny">
	</div>
  </fieldset>
  </form>
  <a class="close-reveal-modal">&#215;</a>
</div>
<!-- end Foreign Fee -->

<!-- Guidance Recommendation-->
<div id="guidance-reccomendation-modal-menu" class="reveal-modal expand">
 <h4 class="subheader">Fee According to Guidance Recommendation</h4>
  <form action="<?=site_url('fees/view_fees/'.$id);?>" method="POST">
  <fieldset>
	<div class="row collapse">
		<div class="small-3 large-2 columns">
		  <span class="prefix">Name of Fee</span>
		</div>
		<div class="small-9 large-10 columns">
		  <input type="text" name="fee_name" autocomplete="off" required>
		</div>
	</div>
	<div class="row collapse">
		<div class="small-3 large-2 columns">
		  <span class="prefix">Charge</span>
		</div>
		<div class="small-9 large-10 columns">
		  <input type="text" name="password" maxlength="20" class="decimal" autocomplete="off" required>
		</div>
	</div>
	<div class="row collapse">
		<input type="submit" name="add_guidance_recommendation" value="Submit" class="button tiny">
		<input type="reset" value="Clear" class="button tiny">
	</div>
  </fieldset>
  </form>
  <a class="close-reveal-modal">&#215;</a>
</div>
<!-- end Guidance Recommendation-->

<!--Scholarships-->
<div id="scholarships" class="reveal-modal expand xlarge">
  <h4 class="subheader">Available Scholarship Packages</h4>
  <fieldset style="background:#FFFFFF;max-height:230px;overflow-x:scroll;padding:0">
			<?if(!empty($scholarships)):?>
	<form action="<?=site_url('fees/view_fees/'.$id);?>" method="POST" class="custom">
	<table style="width:100%;">
		<thead>
			<th>&nbsp;</th>
			<th>Scholarship Name</th>
			<th>Scholarship Description</th>
			<th>Tuition Discount (%)</th>
			<th>Tuition Discount Cash</th>
		</thead>
		<tbody>
				<?foreach($scholarships as $s):?>
					<tr>
						<td style="background:#7F7F7F;border:1px solid #ffffff;"><input type="checkbox" value="<?=$s->ss_id;?>" name="scholarship_id[]"></td>
						<td><?=$s->ss_name;?></td>
						<td><?=$s->ss_desc;?></td>
						<td><?=$s->ss_tuit_percentage;?></td>
						<td><?=$s->ss_tuit_cash;?></td>
					</tr>
				<?endforeach;?>
		</tbody>
	</table>
	<input type="submit" name="add_scholarship" value="Add Scholarship to Student" class="btn btn-primary btn-mini">
	</form>
			<?else:?>
				<table style="width:100%;">
				<tr>
					<td colspan="8" class="alert-box"> No Scholarship has been set. Unable to get scholarships</td>
				</tr>
				</table>
			<?endif;?>
	</fieldset>
  <a href="#" data-reveal-id="main-modal-menu" class="btn btn-mini">Back</a>
  <a class="close-reveal-modal">&#215;</a>
</div>


<!--DEDUCTIONS-->
<div id="deductions" class="reveal-modal">
  <h4 class="subheader">Add Deduction Form</h4>
  <form action="<?=site_url('fees/view_fees/'.$id);?>" method="POST" class="custom">
  <fieldset>
	<div class="row collapse">
		<div class="small-3 large-2 columns">
		  <span class="prefix">Rate</span>
		</div>
		<div class="small-9 large-10 columns">
		  <input type="text" name="deduction_rate" maxlength="20" autocomplete="off" required>
		</div>
	</div>
	<div class="row collapse">
		<label class="label">Deduction Description</label>
		<textarea name="deduction_desc" placeholder="Some description on this deduction"></textarea>
	</div>
	<div class="row collapse">
		<div class="small-9 large-10 columns">
		<?php 
		foreach($available_deductions as $available_deductions):
		?>
			<label class="btn" style="padding:5px; margin:5px 0px;">
			<input type="radio" name="deduction_desc2" value="<?php echo $available_deductions->sdr_remarks; ?>" style="padding:5px; margin:5px 0px;" /> <?php echo $available_deductions->sdr_remarks; ?>
			</label>
		<?php
		endforeach;
		?>
		</div>
	</div>
	<div class="row collapse">
		<input type="submit" name="add_deduction" value="Submit Deduction" class="button tiny">
		<input type="reset" value="clear" class="button tiny">
	</div>
  </fieldset>
  </form>
  <a href="#" data-reveal-id="main-modal-menu" class="btn btn-mini">Back</a>
  <a class="close-reveal-modal">&#215;</a>
</div>

<div id="assessment_fee_from" class="reveal-modal">

<a class="close-reveal-modal">&#215;</a>
<div class="row over">
	<div class="panel"><h6>Payment Center Assessment Fee</h6></div>
	<?echo form_open('fees/view_fees/'.$id,'class="custom" autocomplete="off""');?>
	<div class="large-12 columns">
				
		<div class="row collapse">
			<span style="font-size:10px; color:red; display:none;" id="spr_or_no_notice">Payment OR number cannot be blank. Required entry.</span>
			<div class="small-4 large-4 columns">
				<span class="prefix">OR Number</span>
			</div>
			<div class="small-8 large-8 columns">
				<input type="text" id="spr_or_no" name="spr_or_no" autocomplete="off" placeholder="Payment OR Number">
			</div>
		</div>
	
		<div class="row collapse">
			<div class="small-4 large-4 columns">
				<span class="prefix">Date of Payment</span>
			</div>
			<div class="small-8 large-8 columns">
				<input type="text" name="date_of_payment" autocomplete="off"  placeholder="MM/DD/YYY " class ="datepicker-payment">
			</div>
		</div>
		
		<div class="row collapse">
			<span style="font-size:10px; color:red; display:none;" id="schedule_for_testing_notice">Schedule of Testing cannot be blank. Required entry.</span>
			<div class="small-4 large-4 columns">
				<span class="prefix">Schedule of Testing</span>
			</div>
			<div class="small-8 large-8 columns">
				<input type="text" id="schedule_for_testing" name="schedule_for_testing" autocomplete="off"  >
			</div>
		</div>
		
		<div class="row collapse">
			<div class="small-3 large-3 columns">
				How did you hear of us:
			</div>
			<div class="small-9 large-9 columns" style="margin:2px 0px; padding:2px 0px;">
				<span class="left"><?=form_checkbox('billboard', 'yes', FALSE);?></span><span class="left">&nbsp;&nbsp;Billboard&nbsp;&nbsp;</span><span class="left"><?=form_checkbox('signs_brochures', 'yes', FALSE);?></span><span class="left">&nbsp;&nbsp;Signs/Brochures&nbsp;&nbsp;</span><span class="left"><?=form_checkbox('driving_by', 'yes', FALSE);?></span><span class="left">&nbsp;&nbsp;Driving By&nbsp;&nbsp;</span>
			</div>
		</div>
		
		<div class="row collapse">
			<div class="small-3 large-3 columns">
				&nbsp;
			</div>
			<div class="small-9 large-9 columns" style="margin:2px 0px; padding:2px 0px;">
				<span class="left"><?=form_checkbox('friends_relatives', 'yes', FALSE);?></span><span class="left">&nbsp;&nbsp;Friends/Relatives&nbsp;&nbsp;</span><span class="left"><?=form_checkbox('website', 'yes', FALSE);?></span><span class="left">&nbsp;&nbsp;Website&nbsp;&nbsp;</span><span class="left"><?=form_checkbox('bluebook', 'yes', FALSE);?></span><span class="left">&nbsp;&nbsp;Bluebook&nbsp;&nbsp;</span>
			</div>
		</div>
		
		<div class="row collapse">
			<div class="small-3 large-3 columns">
				&nbsp;
			</div>
			<div class="small-9 large-9 columns" style="margin:2px 0px; padding:2px 0px;">
				<span class="left"><?=form_checkbox('facebook', 'yes', FALSE);?></span><span class="left">&nbsp;&nbsp;Facebook&nbsp;&nbsp;</span><span class="left"><?=form_checkbox('malls', 'yes', FALSE);?></span><span class="left">&nbsp;&nbsp;Malls&nbsp;&nbsp;</span><span class="left"><?=form_checkbox('others', 'yes', FALSE);?></span><span class="left">&nbsp;&nbsp;Others&nbsp;&nbsp;</span><span class="left"><input type="text" name="for_others" autocomplete="off" ></span>
			</div>
		</div>
	
	<div class="large-12 columns">
		<hr class="clearfix">

		<div class="input-fields">
			<div class="large-2 columns">
			<!--
				<label class="label secondary">Quantity</label>
				<input type="text" value="1" disabled>
			-->
				<input type="hidden" name="quantity" class="quantity" value="1">
			</div>
			
			<div class="large-4 columns">
				<label class="label secondary">Description</label>
				<input type="text" value="Assessment Fee" disabled>
				<input type="hidden" name="desc" class="description" value="Assessment Fee" >
			</div>
			
			<div class="large-3 columns">
				<label class="label secondary">Unit Price</label>
				<div class="row collapse">
					<div class="small-3 large-2 columns">
						<span id="amount_money" class="prefix">&#8369;</span>
					</div>
					<div class="small-9 large-10 columns">
						<input type="text" value="2,500" disabled>
						<input type="hidden" name="price" class="unitprice" value="2500" >
					</div>
				</div>
			</div>
			
			<div class="large-3 columns">
				<label class="label secondary">Total</label>
				<div class="row collapse">
					<div class="small-3 large-2 columns">
						<span id="amount_money" class="prefix">&#8369;</span>
					</div>
					<div class="small-9 large-10 columns">
						<input type="text" value="2,500" disabled>
					</div>
				</div>
			</div>
			<hr class="clearfix">
		</div>
		
		<div id='dynapage'>
			<!-- df  -->
		</div>
		
		<input type="hidden" name="loc_sdi" value="<?echo $token;?>">
		<input type="submit" class="button tiny" id="update_applicant_status" name="update_applicant_status" value="Update Applicant Status">
		</div>
	</div>	
	<?php echo form_close(); ?>
	</div>
</div>

<script>
	 $('#assessment_fee').bind('click submit', function(event) {
		if($('#spr_or_no').val()!='' && $('#spr_or_no').val()!=' ')
		{
			$("#spr_or_no_notice").css({ display: "none" });
		}else{
			$("#spr_or_no_notice").css({ display: "block" });
		}
		
		if($('#schedule_for_testing').val()!='' && $('#schedule_for_testing').val()!=' ')
		{
			$("#schedule_for_testing_notice").css({ display: "none" });
		}else{
			$("#schedule_for_testing_notice").css({ display: "block" });
		}
	  
	  if($('#spr_or_no').val()=='' || $('#spr_or_no').val()==' ' || $('#schedule_for_testing').val()=='' || $('#schedule_for_testing').val()==' ')
	  {
		event.preventDefault();
	  }
    });
	
	$('.decimal').keyup(function(){
    var val = $(this).val();
    if(isNaN(val)){
         val = val.replace(/[^0-9\.]/g,'');
         if(val.split('.').length>2) 
             val =val.replace(/\.+$/,"");
    }
    $(this).val(val); 
	});
</script>